#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
Example demostrating FlexGridSizer

www.zetcode.com
"""

import wx

class Example(wx.Frame):
    
    def __init__(self, parent, title):
        super(Example, self).__init__(parent, title=title, size=(300, 250))
        
        self.InitUI()
        self.Centre()
        self.Show()
        
    def InitUI(self):
        
        panel = wx.Panel(self)
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        fgs = wx.FlexGridSizer(3,  2, 9, 25)
        
        title = wx.StaticText(panel, label='Title')
        author = wx.StaticText(panel, label='Author')
        review = wx.StaticText(panel, label='Review')

        title_text_control = wx.TextCtrl(panel)
        author_text_control = wx.TextCtrl(panel)
        review_text_control = wx.TextCtrl(panel)
        

        fgs.AddMany([(title), (title_text_control, 1, wx.EXPAND),
                     (author), (author_text_control, 1, wx.EXPAND),
                     (review, 1, wx.EXPAND), (review_text_control, 1, wx.EXPAND)])

        fgs.AddGrowableRow(2, 1)
        fgs.AddGrowableCol(1, 1)
        
        hbox.Add(fgs, proportion=1, flag=wx.ALL|wx.EXPAND, border=15)
        panel.SetSizer(hbox)

if __name__ == '__main__':
    app = wx.App()
    Example(None, title='Review')
    app.MainLoop()

